#!/bin/bash
service_type=${SERVICE_TYPE}    #服务类型  [api|crawl]
instance_id=${INSTANCE_ID}		#实例ID		0,1,2...,不能重复

#设置服务名称、服务描述、执行程序
#服务类型 api|crawl
case "${service_type}" in
"api")
    service_name="hms_${service_type}_${instance_id}"
;;
"service")
    service_name="hms_as_${service_type}_${instance_id}"
;;
*)
echo "hms start error with invalid service_type[${service_type}] "
exit
;;
esac

#服务名称
#清除多余字符串
service_name=$(echo -n ${service_name} | tr '[A-Z]' '[a-z]')


systemctl start ${service_name}
